A virtual machine operating system is well known today, and includes a common base portion and separate user portions formed by the common base portion. In an IBM z/VM operating system, the common base portion is called the “Control Program” or “CP” and each user portion is called a “virtual machine” or “guest”. A virtual machine or guest is a virtual sharing/partitioning of real resources such as real memory, CPU and I/O. A guest operating system executes/runs on each virtual machine, and one or more applications run on the guest operating system. Each application and guest operating system behave as if they are running on their own private, real computer.
Each virtual machine has its own dispatch function which consists of its synchronization function, work queue assignment function, work scheduler and associated work queue of work items or tasks assigned by and to the virtual machine. The synchronization function, work queue assignment function, work scheduler and the work queue are all private to the virtual machine. A synchronization function manages locks to control which tasks must run sequentially and which tasks can run in parallel. A work queue assignment function is a program function within the virtual machine which adds work items to the work queue of the virtual machine when generated by the virtual machine. Each work item on the queue includes information indicating its type, and therefore, which function within the virtual machine is best suited to handle it. A “work scheduler” is a program function which schedules each of the work items on its queue for execution, and passes them to the appropriate function within the virtual machine for execution. There are many known algorithms for scheduling work items. They may be based on a variety of factors such as a priority level assigned to each task, the order in which the work items arrived on the queue, etc. Some of those work items originate from the guest operating system and others originated from the application(s) running on the guest operating system.
It is wasteful of the virtual machine and the associated partition of real computer resources for the virtual machine to be idle. This may occur when there are no work items on the associated work queue, and the current work item is completed. While the foregoing dispatch function is effective in assigning and dispatching tasks, it would be desirable to manage the dispatch functions of multiple virtual machines so as to optimally balance loads and skills between different virtual machines.
It was also known that a server virtual machine can be utilized for the purpose of “hosting” a shared work queue for the other, “working” virtual machines. The shared work queue resides in memory private to the server virtual machine. When a working virtual machine creates a new work item, and the work queue assignment function for this working virtual machine decides to send this new work item to the server virtual machine, it uses a communication protocol (e.g. TCP/IP) to send that work item to this server virtual machine. Then, the server virtual machine places the new work item on the shared work queue in an order determined by the server virtual machine. When a work scheduler within a working virtual machine wants to execute a work item on the shared work queue, it uses a communication protocol to make that request to the server virtual machine. In response, the server virtual machine uses a communication protocol to send a work item to the working virtual machine that made the request. While this arrangement provides a shared work queue, it requires a high overhead communication protocol to both send a work item to the work queue and obtain a work item from the work queue. In addition this arrangement requires an extra virtual machine to manage the shared work queue. Furthermore, the server virtual machine attempts to balance the load among the working virtual machines by monitoring the working virtual machines and estimating which working virtual machine will be able to handle the work item most expeditiously. The server virtual machine must also be able to re-balance the load among working virtual machines when working virtual machines are dynamically added and/or deleted. Still further, the server virtual machine must synchronize the work items as determined by its private synchronization function. All these server virtual machine functions require considerable communication between the server virtual machine and the working virtual machines.
Accordingly, an object of the present invention is to provide functionality in a virtual machine operating system which effectively balances work loads and/or skills between different virtual machines.
Another object of the present invention is to provide functionality in a virtual machine operating system of the foregoing type which minimizes overhead required to manage the dispatch and other functions.